<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .active{
            border: 1px red dashed;
        }
    </style>
</head>
<body>
<div id="app">
    <img v-bind:src="imgSrc">
<!--    省略写法-->
    <img :src="imgSrc" :title="imgTitle">
    <img :src="imgSrc" :title="imgTitle" :class="isActive?'active':''" @click="changeClass">
<!--    对象方式-->
    <img :src="imgSrc" :title="imgTitle" :class="{active:isActive}" @click="changeClass">
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            imgSrc:'../img/zyeb.jpg',
            imgTitle:'章鱼恶霸',
            isActive:false
        },
        methods:{
            changeClass:function () {
                this.isActive = !this.isActive;

            }
        }
    })

</script>
</body>
</html>